#ifndef FRMMAIN_H
#define FRMMAIN_H

#include <QMainWindow>
#include <QtSql>
#include "selfselectw.h" //自选widget
#include "individualstockw.h"//个股widget
#include "quotesw.h" //行情widget
#include "tradew.h" //交易
#include "selectstockw.h" //选股
#include "infow.h" //资讯
#include "circlew.h" //圈子
#include "discoverw.h" //发现

class QMenu;
class QMenuBar;
class QStatusBar;
class QLabel;
class QmodelIndex;

namespace Ui {
class frmMain;
}

class frmMain : public QMainWindow
{
    Q_OBJECT

public:
    explicit frmMain(QWidget *parent = 0);
    ~frmMain();

    QMenu* mainMenu[14];
    QAction* act[10];
    QMenuBar* menuBar;
    QStatusBar* status;

public slots:
    //void trigerMenu(QAction* act);

private slots:
    //void ChooseWidgets();  //切换widget(主窗口左侧小图标）

    void change_style();            //切换样式

    void screen_full();             //全屏模式
    void screen_normal();           //普通模式

    void on_act_self_sel_stock_setting_triggered();

    void on_act_agency_transaction_triggered();

    void on_act_zoom_triggered();

    void on_act_quit_triggered();

    void on_act_min_triggered();

    void on_btnSelfSelect_clicked();
    void on_btnIndividualStock_clicked();
    void on_btnQuotes_clicked();
    void on_btnTrade_clicked();
    void on_btnInfo_clicked();
    void on_btnCircle_clicked();
    void on_btnDiscover_clicked();
    void on_btnSelectStock_clicked();

    void on_act_mini_window_triggered();

private:
    Ui::frmMain *ui;

    SelfSelectW *selfSelectWidget;
    IndividualStockW *individualStockWidget;
    QuotesW *quotesWidget;
    TradeW *tradeWidget;
    SelectStockW *selectStockWidget;
    InfoW *infoWidget;
    CircleW *circleWidget;
    DiscoverW *discoverWidget;

    QSqlDatabase db;
    QString login;
    QString password;
    QString ip;
    QString port;

    QMenu *menuStyle;               //样式菜单
    QMenu *menu;                    //鼠标右键菜单对象
    void InitStyle();               //初始化无边框窗体
    void InitForm();                //初始化窗体数据

    void create_db_connection();

    void create_main_menu();
};

#endif // FRMMAIN_H
